/*
 * @Author: myw
 * @Email: 516378746@qq.com
 * @Date: 2020-02-24 08:48:29
 * @Descripttion: 
 */
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';

import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { NgZorroAntdModule, NZ_I18N, zh_CN } from 'ng-zorro-antd';
/* 公共 module */
import { HCommonModule } from "./h-common/h-common.module"

/** 配置 angular i18n **/
import { registerLocaleData, PathLocationStrategy, APP_BASE_HREF, LocationStrategy, HashLocationStrategy } from '@angular/common';
import zh from '@angular/common/locales/zh';

import { LoginComponent } from './login/login.component';
import { HomeComponent } from './home/home.component';

import { DatePipe } from '@angular/common';

/* 拦截器 */
import { HttpInterceptorProviders } from "./http-interceptors";

import { RouteReuseStrategy } from '@angular/router'
import { SimpleReuseStrategy } from './http-interceptors/simpleReuseStrategy.interceptor';

registerLocaleData(zh);


@NgModule({
    declarations: [
        AppComponent,
        LoginComponent,
        HomeComponent
    ],
    imports: [
        BrowserModule,
        FormsModule,
        ReactiveFormsModule,
        HttpClientModule,
        BrowserAnimationsModule,
        /** 导入 ng-zorro-antd 模块 **/
        NgZorroAntdModule,
        HCommonModule,

        AppRoutingModule,
    ],
    /** 配置 ng-zorro-antd 国际化（文案 及 日期） **/
    providers: [
        { 
            // provide: NZ_I18N, 
            useValue: zh_CN,
            provide: LocationStrategy, 
            useClass: HashLocationStrategy
        },   // angular < 9 用此配置
        /* { 
            provide: APP_BASE_HREF, 
            useValue: '',
            useClass: HashLocationStrategy
        }, */      // angular == 9 用此配置
        DatePipe,
        HttpInterceptorProviders,
        {
            provide: RouteReuseStrategy, 
            useClass: SimpleReuseStrategy
        },
    ],
    bootstrap: [AppComponent]
})
export class AppModule { }
